import strategy.interfaces.CouponPricingStrategy;
import strategy.interfaces.PercentDiscountPricingStrategy;
import strategy.interfaces.PricingStrategyFactory;
import junit.framework.TestCase;


public class PricingStrategyFactoryTest extends TestCase {

	private PricingStrategyFactory pricing;
	
	protected void setUp(){
		pricing = PricingStrategyFactory.getInstance();
	}
	
	protected void tearDown(){
		pricing = null;
	}
	
	public void testGetDiscountPricingStrategyForCoupon(){
		setUp();
		assertTrue(pricing.getDiscountPricingStrategy("Coupon") instanceof CouponPricingStrategy);
		tearDown();
	}
	
	public void testGetDiscountPricingStrategyForPercent(){
		setUp();
		assertTrue(pricing.getDiscountPricingStrategy("Percent") instanceof PercentDiscountPricingStrategy);
		tearDown();
	}
	
	public void testGetDiscountPricingStrategyForNull(){
		setUp();
		assertTrue(pricing.getDiscountPricingStrategy("Rubbish") == null);
		tearDown();
	}
}
